#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    QPushButton* btn = new QPushButton("按钮", this);

    btn->move(100, 100);

    resize(800, 600);

    //信号与槽连接
    connect(btn, &QPushButton::clicked, this, &Widget::close);
    //断开信号与槽连接
    disconnect(btn, &QPushButton::clicked, this, &Widget::close);

    ui->setupUi(this);
}

Widget::~Widget()
{
    delete ui;
}
